# -- coding: utf-8 --
# @Time : 2022-3-3 10:37
# @Author : huabao.tan
# @File : query_mysql.py

import random
from tool.sql.db import *

class SqlNameCode(DB):

    def __init__(self):
        super(SqlNameCode, self).__init__()


    def sql(self):
        return '''select code,name from per_main where id = %s ''' % random.randint(1, 964)

    def get_all_data(self):
        return self.get_one(self.sql())

    def result(self):
        dic = {}
        for a in self.get_all_data():
            return a
# for i in range(964):
#     s = SqlNameCode()
#     print(s.result())

